package guoanmaker.provider.business.model;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;
import guoanmaker.provider.helper.common.abstractobj.IdEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name="t_provide_user")
public class ProvideUser extends IdEntity{
	private String username;
	private String password;
	
	@ManyToMany
    @JoinTable(name =  "t_provide_role_user",joinColumns = { @JoinColumn(name = "userid") }, inverseJoinColumns = {
            @JoinColumn(name = "roleid") })
    @JSONField(serialize=false)
    private Set<ProvideRole> roles;
	

}
